From: Brian C. Lane Date: Fri, 2 Jun 2017 15:30:43 +0000 (-0700) Subject: Remove the OSTREE_MAX_RECURSION limit on metadata depth X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~36^2~49 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c651982929ec142d107e87d9f32ca324dffd4772;p=ostree.git Remove the OSTREE_MAX_RECURSION limit on metadata depth This was making it impossible to pull or mirror a large ostree repo, and according to Colin is no longer necessary. It works fine with a test against a repo with 2741 commit and 451468 objects in it. Closes: #899 Closes: #904 Approved by: jlebon --- diff --git a/apidoc/ostree-sections.txt b/apidoc/ostree-sections.txt index 56c5c94e..5e111a96 100644 --- a/apidoc/ostree-sections.txt +++ b/apidoc/ostree-sections.txt @@ -89,7 +89,6 @@ OSTREE_VERSION_HEX ostree-core OSTREE_MAX_METADATA_SIZE OSTREE_MAX_METADATA_WARN_SIZE -OSTREE_MAX_RECURSION OstreeObjectType OSTREE_OBJECT_TYPE_IS_META OSTREE_OBJECT_TYPE_LAST diff --git a/src/libostree/ostree-core.h b/src/libostree/ostree-core.h index c530cea3..c1e014e2 100644 --- a/src/libostree/ostree-core.h +++ b/src/libostree/ostree-core.h @@ -44,13 +44,6 @@ G_BEGIN_DECLS */ #define OSTREE_MAX_METADATA_WARN_SIZE (7 * 1024 * 1024) -/** - * OSTREE_MAX_RECURSION: - * - * Maximum depth of metadata. - */ -#define OSTREE_MAX_RECURSION (256) - /** * OSTREE_SHA256_DIGEST_LEN: * diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index 751129e6..536ba58f 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -152,7 +152,7 @@ typedef struct { guchar csum[OSTREE_SHA256_DIGEST_LEN]; char *path; OstreeObjectType objtype; - guint recursion_depth; + guint recursion_depth; /* NB: not used anymore, though might be nice to print */ } ScanObjectQueueData; static void start_fetch (OtPullData *pull_data, FetchObjectData *fetch); @@ -564,9 +564,6 @@ scan_dirtree_object (OtPullData *pull_data, GCancellable *cancellable, GError **error) { - if (recursion_depth > OSTREE_MAX_RECURSION) - return glnx_throw (error, "Exceeded maximum recursion"); - g_autoptr(GVariant) tree = NULL; if (!ostree_repo_load_variant (pull_data->repo, OSTREE_OBJECT_TYPE_DIR_TREE, checksum, &tree, error)) @@ -1188,13 +1185,6 @@ scan_commit_object (OtPullData *pull_data, gint depth; gboolean is_partial; - if (recursion_depth > OSTREE_MAX_RECURSION) - { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, - "Exceeded maximum recursion"); - goto out; - } - if (g_hash_table_lookup_extended (pull_data->commit_to_depth, checksum, NULL, &depthp)) {